package com.yq.interview.jvm.study;

/**
 * @ClassName StrongReferenceDemo
 * @Description 强引用
 *
 * @Author yaoqiang
 * @Date 2020/11/25 11:07
 * @Version 1.0
 */
public class StrongReferenceDemo {
    public static void main(String[] args) {
        Object obj1=new Object();//默认强引用
        Object obj2=obj1;//强引用不会被回收
        obj1=null;//置空，被垃圾回收
        System.gc();
        System.out.println(obj2);
    }
}
